#ifndef MESSAGES_H_INCLUDED
#define MESSAGES_H_INCLUDED

#include "../Graphics/vector.h"
#include <vector>

// =================== GameMessage =================

enum EGameMessage {
    gmEMPTY,
    gmTOTAL,
};

// =================== WorldMessage =================

enum EWorldMessage {
    wmEMPTY,
    wmMOVE_SELECTION,
    wmSELECT_UINT,
    wmDESELECT_ALL,
    wmBLOCK_MODE_ON,
    wmBLOCK_MODE_OFF,
    wmBLOCK_LINE_ON,
    wmBLOCK_LINE_OFF,
    wmSET_BLOCK_CELL,
    wmSET_START_BLOCK,
    wmSET_FINISH_BLOCK,
    wmLIGHT_SURFACE,
    wmPOINT_ON_MAP
};

class WorldMessage
{
public:
    WorldMessage(EWorldMessage messType = wmEMPTY, vector2i pos = 0, int id = -1):
        m_Type(messType), m_TargetPosition(pos), m_TargetId(id)
    { }

    ~WorldMessage()
    { }

    void Set(EWorldMessage messType, vector2i pos = 0, int id = -1)
    {
        m_Type = messType;
        m_TargetPosition  = pos;
        m_TargetId = id;
    }

    EWorldMessage GetType() { return m_Type; }
    vector2i GetTargetPosition() { return m_TargetPosition; }
    int GetTargetId() { return m_TargetId; }

private:
    EWorldMessage   m_Type;
    vector2i        m_TargetPosition;
    int             m_TargetId;
};

typedef std::vector<WorldMessage> WorldMessages;

// =================== CameraMessage =================

enum ECameraMessage {
    cmEMPTY,
    cmROLL_FORWARD,
    cmROLL_BACKWARD,
    cmROLL_STOP,
    cmSTRAFE_LEFT,
    cmSTRAFE_RIGHT,
    cmSTRAFE_STOP,
    cmMOVE_FRONT,
    cmMOVE_BACK,
    cmMOVE_STOP
};

class CameraMessage
{
public:
    CameraMessage(ECameraMessage messType = cmEMPTY, vector2i pos = 0, int id = -1):
        m_Type(messType), m_TargetPosition(pos), m_TargetId(id)
    { }

    ~CameraMessage()
    { }

    void Set(ECameraMessage messType, vector2i pos = 0, int id = -1)
    {
        m_Type = messType;
        m_TargetPosition  = pos;
        m_TargetId = id;
    }

    ECameraMessage GetType() { return m_Type; }
    vector2i GetTargetPosition() { return m_TargetPosition; }
    int GetTargetId() { return m_TargetId; }

private:
    ECameraMessage  m_Type;
    vector2i        m_TargetPosition;
    int             m_TargetId;
};

typedef std::vector<CameraMessage> CameraMessages;

#endif // MESSAGES_H_INCLUDED
